<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'test_ajaxSelecOptionsLinkJs.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<!-- 前台通用Jquery引用 -->
	<script type="text/javascript" src="<%=path%>/js/jquery/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=path%>/js/selectUtil.js"></script>
	
  </head>
  
  <body>
    将jquery+ajax获取select数据脚本 封装为js文件，并引用. <br>
    
    <h1>测试引用js，是否能生效</h1>
    
    
    <div>
		<h1>获取所有model数据集合</h1>
		书籍:<select name="query.query['eq_book.id_l']" id="selectBook"  ></select>
		
		<input type="button" value="ajax all  " onclick="in1();">
		<input type="button" value="ajax book " onclick="in2();">
		
		<input type="button" value="ajax all：默认选择36 " onclick="in3();">
	
	</div>
    
    <div>
		<h1>获取数据字典数据集合</h1>
		是否状态:<select name="query.query['eq_book.id_l']" id="selectIsOpenStatus"  ></select>
		
		<input type="button" value="ajax all data diction(数据字典) " onclick="in4();">
		<input type="button" value="ajax all data diction(数据字典)：默认选择否 " onclick="in5();">
	</div>
	
	
	<script type="text/javascript">
		// ajax 通用
		function in1(){
			JqajaxSelect.initSelectAll("selectBook","/ajax/all/ajaxBooks.do");
			
		}
		
		// ajax 书籍
		function in2(){
			JqajaxSelect.initSelectAll("selectBook","/ajax/book/ajaxBooks.do");
		}
		
		// ajax 通用，且存在默认值
		function in3(){
			JqajaxSelect.initSelectAll("selectBook","/ajax/all/ajaxBooks.do",36);
		}
		
		// ajax 通用，数据字典
		function in4(){
			JqajaxSelect.initSelectAll("selectIsOpenStatus","/ajax/all/ajaxDataDictYesNo.do");
		}
		
		// ajax 通用，数据字典，且存在默认值
		function in5(){
			JqajaxSelect.initSelectAll("selectIsOpenStatus","/ajax/all/ajaxDataDictYesNo.do",0);
		}
	
	</script>
  </body>
</html>
